﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace CMS_GYM
{
    public class clsKhuyenMaiBUS
    {
        private clsKhuyenMaiDAO KhuyenMaiDAO = new clsKhuyenMaiDAO();

        public DataTable LayBang()
        {
            return KhuyenMaiDAO.LayBang();
        }

        public DataTable LayBangConApDung()
        {
            return KhuyenMaiDAO.LayBangConApDung();
        }

        public clsKhuyenMaiDTO LayThongTinKhuyenMai(int KhuyenMaiId)
        {
            return KhuyenMaiDAO.LayThongTin(KhuyenMaiId);
        }

        public List<clsKhuyenMaiDTO> LayDanhSachKhuyenMaiCuaMotKhachHang(decimal KhachHangId)
        {
            return KhuyenMaiDAO.LayDanhSachKhuyenMaiCuaMotKhachHang(KhachHangId);
        }

        public DataTable LayBangKhuyenMaiCuaMotKhachHang(decimal KhachHangId)
        {
            return KhuyenMaiDAO.LayBangKhuyenMaiCuaMotKhachHang(KhachHangId);
        }

        public int Them(clsKhuyenMaiDTO KhuyenMai)
        {
            return KhuyenMaiDAO.Them(KhuyenMai);
        }

        public int Sua(clsKhuyenMaiDTO NhanVien)
        {
            return KhuyenMaiDAO.Sua(NhanVien);
        }

        public int Xoa(int KhuyenMaiId)
        {
            return KhuyenMaiDAO.Xoa(KhuyenMaiId);
        }

        /// <summary>
        /// Lay gia khuyen mai dong 6 thang duoc huong 
        /// </summary>
        /// <returns></returns>
        public Double KhuyenMaiDongTruocSauThang()
        {
            return KhuyenMaiDAO.KhuyenMaiDongTruocSauThang();
        }

        /// <summary>
        /// Lay gia khuyen mai dong 12 thang duoc huong 
        /// </summary>
        /// <returns></returns>
        public Double KhuyenMaiDongTruocMuoiHaiThang()
        {
            return KhuyenMaiDAO.KhuyenMaiDongTruocMuoiHaiThang();
        }

        /// <summary>
        /// Lay gia khuyen mai sinh nhat va dong 12 ky
        /// <returns></returns>
        public Double KhuyenMaiSinhNhatVaDongMuoiHaiKy()
        {
            return KhuyenMaiDAO.KhuyenMaiSinhNhatVaDongMuoiHaiKy();
        }

        /// <summary>
        /// Cập nhật khuyen mai dong 6 thang duoc huong 
        /// </summary>
        public Boolean CapNhatKhuyenMaiDongTruocSauThang(Double DongTruocSauThang)
        {
            if (KhuyenMaiDAO.CapNhatKhuyenMaiDongTruocSauThang(DongTruocSauThang) != -1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// Cập nhật khuyen mai dong 12 thang duoc huong
        /// </summary>
        public Boolean CapNhatKhuyenMaiDongTruocMuoiHaiThang(Double DongTruocMuoiHaiThang)
        {
            if (KhuyenMaiDAO.CapNhatKhuyenMaiDongTruocMuoiHaiThang(DongTruocMuoiHaiThang) != -1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// Cập nhật khuyen mai sinh nhat va dong 12 ky
        /// </summary>
        public Boolean CapNhatKhuyenMaiSinhNhatVaDongMuoiHaiKy(Double SinhNhatVaDongMuoiHaiKy)
        {
            if (KhuyenMaiDAO.CapNhatKhuyenMaiSinhNhatVaDongMuoiHaiKy(SinhNhatVaDongMuoiHaiKy) != -1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


    }
}
